<?php
/**
 * Created by PhpStorm.
 * User: readLine
 * Date: 2017/11/9
 * Time: 14:11
 */
namespace app\index\controller;
use think\Controller;
use think\Db;

class Editor extends Controller
{
    public function index(){

    }

    //主编的编辑
    public function editEditor(){

        $author_id = input('author_id');
        $data['author_name'] = input('authorName');
        $data['author_work_place'] = input('authorObject');
        $data['author_introduction'] = input('authorIntroduction');
        $data['author_pic'] = input('pic');

        $ret = Db::table('author')->where('author_id','=',$author_id)->update($data);
        if($ret){
            $this->success('修改成功');
        }
        else{
            $this->error('修改失败');
        }

    }

    //副主编的编辑
    public function editSubEditor(){

        $author_id = input('author_id');
        $data['author_name'] = input('authorName');
        $data['author_work_place'] = input('authorObject');

        $ret = Db::table('author')->where('author_id','=',$author_id)->update($data);
        if($ret){
            $this->success('修改成功');
        }
        else{
            $this->error('修改失败');
        }

    }

}